package com.example.dllo.exe.giftspeak;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.dllo.exe.R;

/**
 * code is far away from bug with the animal protecting
 * <p>
 * ┏┓　　　┏┓
 * ┏┛┻━━━┛┻┓
 * ┃　　　　　　　┃
 * ┃　　　━　　　┃
 * ┃　┳┛　┗┳　┃
 * ┃　　　　　　　┃
 * ┃　　　┻　　　┃
 * ┃　　　　　　　┃
 * ┗━┓　　　┏━┛
 * 　　┃　　　┃神兽保佑
 * 　　┃　　　┃永无BUG！  凯哥 祝你一路顺风
 * 　　┃　　　┗━━━┓
 * 　　┃　　　　　　　┣┓
 * 　　┃　　　　　　　┏┛
 * 　　┗┓┓┏━┳┓┏┛
 * 　　　┃┫┫　┃┫┫
 * 　　　┗┻┛　┗┻┛
 */
public class GridViewPopAdapter extends BaseAdapter{
    private Context context;
    private String data[]={"精选","送女票","海淘","创意生活","送基友","送爸妈","送同事","送宝贝","设计感","文艺风","奇葩搞怪","科技范","萌萌哒"};



    @Override
    public int getCount() {
        return data.length;
    }

    public GridViewPopAdapter(Context context) {
        this.context = context;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder viewHolder=null;
        LayoutInflater inflater=LayoutInflater.from(context);
        if (view==null){
            view=inflater.inflate(R.layout.gripviewpoplayout,null);
           viewHolder=new ViewHolder(view);
           view.setTag(viewHolder);
        }else {
            viewHolder = (ViewHolder) view.getTag();
        }
        viewHolder.textViewgird.setTag(i);
        viewHolder.textViewgird.setText(data[i]);
        return view;
    }
    public  class ViewHolder{
        TextView textViewgird;
        public ViewHolder(View view){
            textViewgird= (TextView) view.findViewById(R.id.grid_textview);
        }
    }
}
